#include <iostream>
#include "string"

using namespace std;

/*
 * 每个老师带5个学生，总共3名老师，通过函数给每个老师及带的学生赋值，然后打印
 */

struct Student{
    string sName;
    int score;
};

struct Teacher{
    string tName;
    Student students[5];
};

// 给老师和学生赋值
void setNameAndScore(struct Teacher tArray[], int length) {
    string nameSeed = "ABCDE";
    for (int i = 0; i < length; ++i) {
        tArray[i].tName = "Teacher_";
        tArray[i].tName += nameSeed[i];
        for (int j = 0; j < 5; ++j) {
            tArray[i].students[j].sName = "Student_";
            tArray[i].students[j].sName += nameSeed[j];
            tArray[i].students[j].score = 60 + i;
        }
    }
}

// 打印数组信息
void printMessage(struct Teacher tArray[], int length) {
    for (int i = 0; i < length; ++i) {
        cout << tArray[i].tName << endl;
        for (int j = 0; j < 5; ++j) {
            cout << tArray[i].students[j].sName << "  " << tArray[i].students[j].score << endl;
        }
    }
}

int main() {
    struct Teacher tArray[3];
    setNameAndScore(tArray, 3);
    printMessage(tArray, 3);

    return 0;
}
